package com.bayihouse.utils;

public class MyStringUtils {

    public static String getDeleteMarkStr(String text) {
        text = text.trim();
        String res = text.replaceAll("\\p{Punct}", "");
        res = res.replaceAll("[\\\\pP+~$`^=|<>～｀＄＾＋＝｜＜＞￥×]","");
        return res;
    }


    public static int compareTwo(String text1, String text2) {
        String var1 = MyStringUtils.getDeleteMarkStr(text1);
        String var2 = MyStringUtils.getDeleteMarkStr(text2);
        int len1 = var1.length();
        int len2 = var2.length();
        int i1 = 0, i2 = 0;
        while (i1 < len1 && i2 < len2) {
            if (var1.charAt(i1) != var2.charAt(i2)) {
                char c1 = var1.charAt(i1);
                char c2 = var2.charAt(i2);
                return c1 - c2;
            }
            i1++;
            i2++;
        }
        return len1 - len2;
    }






}
